package com.example.hyznbk.model.api;

import com.example.hyznbk.service.HttpGetServer;
import com.lancoo.rxretrofitlibrary.Api.BaseApi;
import com.lancoo.rxretrofitlibrary.Api.UserInfo;
import com.lancoo.rxretrofitlibrary.listener.HttpOnNextListener;
import com.trello.rxlifecycle.components.support.RxFragment;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by tangminglong on 17/9/15.
 */

public class FavouriteListApi extends BaseApi{

    private int pageIndex = 1;
    private int pageSize = 10;
    private String quesBrief = "";
    private String quesType = "";

    public int getPageIndex() {
        return pageIndex;
    }

    public void setPageIndex(int pageIndex) {
        this.pageIndex = pageIndex;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public String getQuesBrief() {
        return quesBrief;
    }

    public void setQuesBrief(String quesBrief) {
        this.quesBrief = quesBrief;
    }

    public String getQuesType() {
        return quesType;
    }

    public void setQuesType(String quesType) {
        this.quesType = quesType;
    }

    public FavouriteListApi(HttpOnNextListener listener, RxFragment rxFragment) {
        super(listener, rxFragment);
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpGetServer httpGetServer = retrofit.create(HttpGetServer.class);
        return httpGetServer.getFavouriteList(UserInfo.StuId,UserInfo.SubjectId,UserInfo.StageNo,quesType, quesBrief,pageIndex,pageSize);
    }
}
